package com.lz.feibo;

public class Fibnaqie {

	public static int fib(int n) {
		if (n <= 1) {
			return 1;
		} else {
			return fib(n - 1) + fib(n - 2);
		}
	}

	public static void main(String[] args) {
		int fi[] = new int[8];
		int nums = 0;
		for (int i = 0; i < fi.length; i++) {
			fi[i] = Fibnaqie.fib(i);
			System.out.print(fi[i] + "\t");
		}
		System.out.println();
		for (int j = 0; j < fi.length; j++) {
			nums+=fi[j];
		}
		System.out.println(nums);
	}
	  

}
